﻿<Window x:Class="SDKSample.Window1"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"    
  Title="Drag and Drop Events Explorer" Name="mainWindow"
  SizeChanged="ehEventWindowSizeChanged" 
>
  <Grid Name="mainGrid">
    <Grid.RowDefinitions>
      <RowDefinition Height="50"/>
      <RowDefinition Height="*"/>
    </Grid.RowDefinitions>

    <Grid.ColumnDefinitions>
      <ColumnDefinition Width="*"/>
      <ColumnDefinition Width="400"/>
    </Grid.ColumnDefinitions>

    <Border BorderBrush="DarkSeaGreen" BorderThickness="1"
      Grid.Row="0" Grid.Column="0" Grid.RowSpan="2">
      <Border.Background>
        <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
          <LinearGradientBrush.GradientStops>
            <GradientStop Offset="0.0" Color="White"/>
            <GradientStop Offset="1.0" Color="Azure"/>
          </LinearGradientBrush.GradientStops>
        </LinearGradientBrush>
      </Border.Background>
      <TextBlock
        Name="myTextBlock"  
        Text="Drag something into and out of this window area and drop it to observe when the events fire."
        TextAlignment="Center" VerticalAlignment="Stretch" FontWeight="Bold" FontSize="30" TextWrapping="Wrap"
          
        ToolTip="Drag something into and out of this window area and drop it to observe when the events fire"
        AllowDrop="True" 
          
        DragEnter="ehDragEnter"
        DragLeave="ehDragLeave"
        DragOver="ehDragOver"
        Drop="ehDrop"

        PreviewDragEnter="ehPreviewDragEnter"
        PreviewDragLeave="ehPreviewDragLeave"
        PreviewDragOver="ehPreviewDragOver"
        PreviewDrop="ehPreviewDrop" 
        />
    </Border>

    <Border BorderBrush="DarkSeaGreen"  BorderThickness="1" Grid.Row="0" Grid.Column="1">
      <StackPanel 
        Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center"
        Height="50" Width="400"
      >
        <StackPanel.Background>
          <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
            <LinearGradientBrush.GradientStops>
              <GradientStop Offset="0.0" Color="Azure"/>
              <GradientStop Offset="1.0" Color="White"/>
            </LinearGradientBrush.GradientStops>
          </LinearGradientBrush>
        </StackPanel.Background>

        <Button 
          Content="Clear Event History" HorizontalContentAlignment="Center" 
          ToolTip="Click to clear the event history window below." 
          Margin="5" Height="30" HorizontalAlignment="Center"
          Click="clickClearEventHistory"
            />

        <CheckBox 
          Name="cbVerbose" 
          Content=" Show Verbose Event Info" 
          ToolTip="Check for verbose event info.  Clear for brief event info." 
          VerticalAlignment="Center" Margin="5" HorizontalAlignment="Center"
            />
      </StackPanel>
    </Border>

    <StackPanel Name="spEventWindow" Orientation="Vertical" Grid.Row="1" Grid.Column="1">
      <Label 
        Name="lblEventSelectionTitle" Width="400" Height="25" 
        HorizontalContentAlignment="Center"  
        Background="DarkSeaGreen"  FontWeight="Bold" 
        Content="Events To Monitor"
          />
      <Grid Name="eventChecksGrid" Height="130" Margin="5,0,0,0">
        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="*"/>
          <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
          <RowDefinition Height="*"/>
          <RowDefinition Height="*"/>
          <RowDefinition Height="*"/>
          <RowDefinition Height="*"/>
          <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Label Grid.Column="0" Grid.Row="0" Margin="2" FontWeight="Bold"
          Content="Bubbling Events"
          ToolTip="The non-preview events are bubbling events, an event routing strategy where the event instance moves up the element tree (starting with the source and ending at the root of the visual tree)."
            />
        <Label Grid.Column="1" Grid.Row="0" Margin="2" FontWeight="Bold"
          Content="Tunneling Events"
          ToolTip="The preview events are tunneling events, an event routing strategy where the event instance moves down the element tree (starting at the root of the visual tree and ending with the source). In Windows Presentation Foundation, the names of events that use this routing strategy are prefixed with the word &quot;Preview&quot;. These events have the same signature as their counterparts that use the bubbling event routing strategy."
            />
        <CheckBox Name="cbDragEnter" Grid.Column="0" Grid.Row="1" Margin="2" IsChecked="True"
          Content="DragEnter" 
          ToolTip="Check to listen for the DragEnter event; clear to ignore the DragEnter event."
            />
        <CheckBox Name="cbDragLeave" Grid.Column="0" Grid.Row="2" Margin="2" IsChecked="True"
          Content="DragLeave" 
          ToolTip="Check to listen for the DragLeave event; clear to ignore the DragLeave event."
            />
        <CheckBox Name="cbDragOver" Grid.Column="0" Grid.Row="3" Margin="2" IsChecked="True"
          Content="DragOver" 
          ToolTip="Check to listen for the DragOver event; clear to ignore the DragOver event."
            />
        <CheckBox Name="cbDrop" Grid.Column="0" Grid.Row="4" Margin="2" IsChecked="True"
          Content="Drop" 
          ToolTip="Check to listen for the Drop event; clear to ignore the Drop event."
            />
        <CheckBox Name="cbPreviewDragEnter" Grid.Column="1" Grid.Row="1" Margin="2" IsChecked="True"
          Content="PreviewDragEnter" 
          ToolTip="Check to listen for the PreviewDragEnter event; clear to ignore the PreviewDragEnter event."
            />
        <CheckBox Name="cbPreviewDragLeave" Grid.Column="1" Grid.Row="2" Margin="2" IsChecked="True"
          Content="PreviewDragLeave" 
          ToolTip="Check to listen for the PreviewDragLeave event; clear to ignore the PreviewDragLeave event."
            />
        <CheckBox Name="cbPreviewDragOver" Grid.Column="1" Grid.Row="3" Margin="2" IsChecked="True"
          Content="PreviewDragOver" 
          ToolTip="Check to listen for the PreviewDragOver event; clear to ignore the PreviewDragOver event."
            />
        <CheckBox Name="cbPreviewDrop" Grid.Column="1" Grid.Row="4" Margin="2" IsChecked="True"
          Content="PreviewDrop" 
          ToolTip="Check to listen for the PreviewDrop event; clear to ignore the PreviewDrop event."
            />
      </Grid>
      <Label 
        Name="lblEventLogWindowTitle" Width="400" Height="25" 
        HorizontalContentAlignment="Center"  
        Background="DarkSeaGreen" FontWeight="Bold" 
        Content="Event History"
          />
      <TextBox ClipToBounds="True"
        Name="tbEventEvents" 
        VerticalScrollBarVisibility="Auto" AcceptsReturn="True" IsReadOnly="True" 
          />
    </StackPanel>
  </Grid>
</Window>
